package com.ls.thread.account;

public class Account {
	private int money;

	public Account(int money) {
		super();
		this.money = money;
		System.out.println("账户开始金额为："+money);
	}
	
	public synchronized void setMoney(int money){
		
		try {
			notify();
			this.money=this.money+money;
			System.out.println(Thread.currentThread().getName()+"存钱："+money);
			System.out.println("\t"+Thread.currentThread().getName()+"存钱后账户余额为："+this.money);
			
			wait();
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
			
		
	}
	

}
